package com.chinacache.maint.webssh.entity.ssh;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.chinacache.maint.commons.entity.BaseEntity;

@Entity
@Table(name = "SSH_COMMANDLOG")
public class CommandLog extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String commandLog;
	private Integer commandType;
	private String time;
	private Device device;
	private String userName;

	@Id
	@Column(name = "COM_LOG_ID")
	@GeneratedValue(generator = "SEQ_RPT_USER_TO_CLASS")
	@GenericGenerator(name = "SEQ_RPT_USER_TO_CLASS", strategy = "seqhilo", parameters = { @Parameter(name = "sequence", value = "SEQ_RPT_USER_TO_CLASS") })
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "COMMAND_LOG")
	public String getCommandLog() {
		return commandLog;
	}

	public void setCommandLog(String commandLog) {
		this.commandLog = commandLog;
	}

	@Column(name = "COMMAND_TYPE")
	public Integer getCommandType() {
		return commandType;
	}

	public void setCommandType(Integer commandType) {
		this.commandType = commandType;
	}

	@Column(name = "TIME")
	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	//
	// @ManyToOne(fetch = FetchType.LAZY)
	// @JoinColumn(name = "USER_ID")
	// public User getUser() {
	// return user;
	// }
	//
	// public void setUser(User user) {
	// this.user = user;
	// }

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEV_ID")
	public Device getDevice() {
		return device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	@Column(name = "USER_NAME")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
}
